package sprites;

import com.golden.gamedev.object.Timer;

import engine.TowerDefense;
import sprites.GreenBullet;

/**
 * A machine-gun tower. Considerably more powerful.
 * 
 * @author Alex Lee (hl69)
 */
public class MGTower extends Tower
{
	
	public MGTower(TowerDefense owner, double x, double y)
	{
		super(owner, owner.getImages("resources/mgtower.png", 1, 1), x, y);
		
		hitpoints = 400;
		firingRate = new Timer(400);
		range = INFINITE_RANGE;
	}
	
	public void update(long elapsedTime)
	{
		super.update(elapsedTime);
		
		if(firingRate.action(elapsedTime) && firing)
		{
			Projectile p = new GreenBullet(myOwner, getX()+60, getY()+60);
			myOwner.TOWER_P.add(p);
		}
	}

}
